home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / PaperCut Quota / pc-setup.exe / {app} / WebAdmin / NetLog.asp < prev    next >
Text File  |  2004-10-05  |  3KB  |  81 lines

  1. <%@ Language=VBScript %>
  2. <%' (c) Copyright 1999-2004 PaperCut Software Pty. Ltd. %>
  3. <!-- #INCLUDE FILE="includes/PCCommon.inc" -->
  4. <%
  5. Dim intMAX_COUNT 
  6. intMAX_COUNT = 100 
  7.  
  8. %>
  9. <!-- #INCLUDE FILE="includes/header.inc" -->
  10. <%
  11.  
  12. Dim objPCWebNetLog 
  13. Set objPCWebNetLog        = CreateObject("PCWebAdmin.PCWebNetLog")
  14. If objPCWebNetLog.Error Then
  15.     WriteErrorMessage objPCWebNetLog.ErrorDescription
  16. End If
  17.  
  18. Dim strUserName 
  19. strUserName = Trim(Request("strUserName"))
  20.  
  21. If Not gblnIsAdmin or Request("strMyLogs") <> "" Then
  22.     strUserName = gstrLoggedInUser
  23. End If
  24.  
  25. If strUserName <> "" Then
  26.     objPCWebNetLog.RestrictedOnUser(Trim(strUserName))    
  27.     Response.Write "<H1>" & GetTextReplace("RecentNetUsageBy", Array(strUserName)) &  "</H1>"
  28.     WriteUserAdminLinks(strUserName) 
  29.     Call DisplayList(False)
  30.     WriteUserAdminLinks(strUserName) 
  31. Else
  32.     'objPCWebNetLog.FullLog ' Defaults to this anyway    
  33.     Response.Write "<H1>" & GetText("RecentNetUsage") & "</H1>"
  34.     Call DisplayList(True)
  35. End If
  36. Set objPCWebNetLog = Nothing
  37.  
  38. Sub DisplayList(blnShowUser)
  39.     Response.Write "<CENTER>" & vbCRLF
  40.     Response.Write "<TABLE class=""webAdmin"" width=""95%"" >"    & vbCRLF
  41.     Response.Write "<TR>" & vbCRLF
  42.     Response.Write "<TH width=""10%"">" & GetText("Date") & "</TH>" & vbCRLF
  43.     If blnShowUser Then
  44.         Response.Write "<TH width=""30%"">" & GetText("User") & "</TH>" & vbCRLF
  45.     End If
  46.     Response.Write "<TH width=""20%"">" & GetText("DataUsed") & "</TH>" & vbCRLF
  47.     Response.Write "<TH width=""20%"">" & GetText("TimeUsed") & "</TH>" & vbCRLF
  48.     Response.Write "<TH width=""20%"">" & GetText("Cost") & "</TH>" & vbCRLF
  49.     Response.Write "</TR>" & vbCRLF
  50.  
  51.     
  52.     objPCWebNetLog.MoveFirst
  53.     Dim intCount    
  54.     intCount = 0
  55.  
  56.     do while ((not objPCWebNetLog.EOF) and intCount < intMAX_COUNT)
  57.  
  58.         Response.Write "<TR class=""" & RowClassHelper(intCount) & """>"    & vbCRLF
  59.         Response.Write "<TD nowrap align=left>" & objPCWebNetLog.LogDate & "</TD>"  & vbCRLF
  60.         
  61.         If blnShowUser Then
  62.             Response.Write "<TD nowrap align=left><a title=""" & GetTextReplace("ViewUserLogs", Array(objPCWebNetLog.UserName)) & """ href=""NetLog.asp?strUserName=" & Server.URLEncode(objPCWebNetLog.UserName) & """>" & objPCWebNetLog.UserName & "</A></TD>"  & vbCRLF
  63.         End If
  64.         
  65.         Response.Write "<TD align=right>" & objPCWebNetLog.TotalMBText & " " & GetText("MBAbbr") & "</TD>"  & vbCRLF
  66.         Response.Write "<TD align=right>" & objPCWebNetLog.TotalNetHoursText & " " & GetText("HoursAbbr") & "</TD>"  & vbCRLF
  67.         Response.Write "<TD align=right>" & objPCWebNetLog.CostText & "</TD>"  & vbCRLF
  68.         
  69.         Response.Write "</TR>" & vbCRLF
  70.         objPCWebNetLog.MoveNext
  71.         intCount = intCount + 1
  72.     loop
  73.     Response.Write "</TABLE>" & vbCRLF
  74.     Response.Write "</CENTER>" & vbCRLF
  75.  
  76. End Sub
  77.  
  78.  
  79. %>
  80. </CENTER>
  81. <!-- #INCLUDE FILE="includes/footer.inc" -->